<%@ page language="java" autoFlush="true" errorPage="../error.jsp"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/tld/timetable.tld" prefix="tt" %>
<TABLE width="100%" border="0" cellspacing="0" cellpadding="3">
	<TR>
		<TD align="right" colspan="5">
			<tt:section-header>
				<tt:section-title>
					<span style='font-weight:normal;'>
					<% if (request.getAttribute("roomGroupsGlobal") != null) {%>
						<A class="l7" href="#roomGroupsGlobal">Grupos globales de sala</A>&nbsp;
					<% } %>
					<% if (request.getAttribute("roomGroupsDepartment") != null) {%>
						<A class="l7" href="#roomGroupsDepartment">Grupos de sala de departamento</A>&nbsp;
					<% } %>
					</span>
				</tt:section-title>
			<TABLE align="right" cellspacing="0" cellpadding="2" class="FormWithNoPadding">
				<TR>
					<logic:equal name="roomGroupListForm" property="deptSize" value="false">
						<TD>
							<html:form action="roomGroupList" styleClass="FormWithNoPadding">			
								<html:submit property="op" onclick="displayLoading();" styleClass="btn" accesskey="P" titleKey="title.exportPDF">
									<bean:message key="button.exportPDF" />
								</html:submit>
							</html:form>
						</TD>
					</logic:equal>
					<logic:equal name="roomGroupListForm" property="canAdd" value="true">
						<TD nowrap>
							<html:form action="roomGroupAdd" styleClass="FormWithNoPadding">			
								<html:submit property="doit" onclick="displayLoading();" styleClass="btn" accesskey="G" title="Add New Room Group">
									<bean:message key="button.addNewRoomGroup" />
								</html:submit>
							</html:form>
						</TD>
					</logic:equal>
					<%--
					<TD nowrap>
						<html:form action="roomList">
							<html:submit property="doit" onclick="displayLoading();" styleClass="btn" accesskey="R" title="Return to Room List">
								<bean:message key="button.returnToRoomList" />
							</html:submit>
						</html:form>
					</TD>
					--%>
				</TR>
			</TABLE>
			</tt:section-header>
		</TD>
	</TR>
	<logic:messagesPresent>
	<TR>
		<TD colspan="5" align="left" class="errorCell">
			<B><U>Errores</U></B><BR>
			<BLOCKQUOTE>
			<UL>
			    <html:messages id="error">
			      <LI>
					${error}
			      </LI>
			    </html:messages>
		    </UL>
		    </BLOCKQUOTE>
		</TD>
	</TR>
	</logic:messagesPresent>
	<% if (request.getAttribute("roomGroupsGlobal") != null) {%>
		<TR>
			<TD valign="middle" colspan="3">
				&nbsp;<A name="roomGroupsGlobal"></A>
			</TD>
		</TR>
		<%=request.getAttribute("roomGroupsGlobal")%>
	<%}%>
	<% if (request.getAttribute("roomGroupsDepartment") != null) {%>
		<TR>
			<TD valign="middle" colspan="3">
				&nbsp;<A name="roomGroupsDepartment"></A>
			</TD>
		</TR>
		<%=request.getAttribute("roomGroupsDepartment")%>
	<%}%>
	<% if (request.getAttribute("roomGroupsDepartment") == null && request.getAttribute("roomGroupsGlobal") == null) {%>
		<TR>
			<TD valign="middle" colspan="3">
				<i>No hay grupos de sala disponibles para el departamento seleccionado.</i>
			</TD>
		</TR>
	<% } %>
	<TR>
		<TD valign="middle" colspan="5">&nbsp;</TD>
	</TR>
	<TR>
		<TD valign="middle" colspan="5">
			<tt:section-header>
			<tt:section-title>
				<% if (request.getAttribute("roomGroupsGlobal") != null) {%>
					<A class="l7" href="#roomGroupsGlobal"><span style='font-weight:normal;'>Grupos globales de sala</span></A>&nbsp;
				<% } %>
				<% if (request.getAttribute("roomGroupsDepartment") != null) {%>
					<A class="l7" href="#roomGroupsDepartment"><span style='font-weight:normal;'>Grupos de sala de departamento</span></A>&nbsp;
				<% } %>
			</tt:section-title>
			</tt:section-header>
		</TD>
	</TR>
	<TR>
		<TD align="right" colspan='5'>
			<TABLE align="right" cellspacing="0" cellpadding="2" class="FormWithNoPadding">
				<TR>
					<logic:equal name="roomGroupListForm" property="deptSize" value="false">
						<TD nowrap>
							<html:form action="roomGroupList">			
								<html:submit property="op" onclick="displayLoading();" styleClass="btn" accesskey="P" titleKey="title.exportPDF">
									<bean:message key="button.exportPDF" />
								</html:submit>
							</html:form>
						</TD>
					</logic:equal>
					<logic:equal name="roomGroupListForm" property="canAdd" value="true">
						<TD nowrap>
							<html:form action="roomGroupAdd">			
								<html:submit property="doit" onclick="displayLoading();" styleClass="btn" accesskey="G" title="Agregar nuevo grupo de salas">
									<bean:message key="button.addNewRoomGroup" />
								</html:submit>
							</html:form>
						</TD>
					</logic:equal>
					<%--
					<TD nowrap>
						<html:form action="roomList">
							<html:submit property="doit" onclick="displayLoading();" styleClass="btn" accesskey="R" title="Volver a la lista de salas">
								<bean:message key="button.returnToRoomList" />
							</html:submit>
						</html:form>
					</TD>
					--%>
				</TR>
			</TABLE>
		</TD>	
	</TR>
</TABLE>
<SCRIPT type="text/javascript" language="javascript">
    <% if (request.getAttribute("hash") != null) { %>
  		location.hash = "<%=request.getAttribute("hash")%>";
	<% } %>
</SCRIPT>